﻿using HomeCareLibrary.Core.Dtos;
using HomeCareLibrary.DataAccess;
using HomeCareLibrary.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HomeCareLibrary.AppService.Mappers;

namespace HomeCareLibrary.AppService
{
    public class taskAppService : AppServiceBase
    {
        public List<CTTipDetailDto> GetRoutineTask(string dwell_priority_kl_loc, string feature_string, string ps_goal_string, string turn_offs, string startmonth, string startyear, string requestedmonth, string requestedyear, int user_ID, int home_number)
        {
            using (var unitOfWork = new UnitOfWork())
            {
                var tipRepository = new Repository<CTTipDetail>(unitOfWork);
                var queryParameter = string.Format("@dwell_priority_kl_loc={0},@feature_string={1},@ps_goal_string={2},@turn_offs={3},@startmonth={4},@startyear={5},@requestedmonth={6},@requestedyear={7},@user_ID={8},@home_number={9}", dwell_priority_kl_loc, feature_string, ps_goal_string, turn_offs, startmonth, startyear, requestedmonth, requestedyear, user_ID, home_number);
                return tipRepository.ExecuteFuntion("[sp_Routinetask]", queryParameter).ToDTOs();
            }
        }
    }
}
